<!--
 * createor: zc
 * email: zc8023zs@163.com
 * create_time: 2020/3/14 13:46:24
 *-->
<template>
  <el-container>
    <el-header>
      城市运营中心详情
    </el-header>
    <el-main>
      <el-form label-width="200px" :inline="true" style="padding:5% 5% 0 5%">
        <el-form-item label="自增主键：">
          <span>{{formData.id}}</span>
        </el-form-item>
        <el-form-item label="部门id：">
          <span>{{formData.dept_id}}</span>
        </el-form-item>
        <el-form-item label="角色id：">
          <span>{{formData.role_id}}</span>
        </el-form-item>
        <el-form-item label="员工编号：">
          <span>{{formData.user_number}}</span>
        </el-form-item>
        <el-form-item label="员工登录账号：">
          <span>{{formData.user_name}}</span>
        </el-form-item>
        <el-form-item label="员工真实姓名：">
          <span>{{formData.real_name}}</span>
        </el-form-item>
        <el-form-item label="登录密码：">
          <span>{{formData.passwd}}</span>
        </el-form-item>
        <el-form-item label="男=1 女=2：">
          <span>{{formData.gender}}</span>
        </el-form-item>
        <el-form-item label="手机号码：">
          <span>{{formData.mobile}}</span>
        </el-form-item>
        <el-form-item label="电子邮箱：">
          <span>{{formData.email}}</span>
        </el-form-item>
        <el-form-item label="0=禁用 1=启用：">
          <span>{{formData.status}}</span>
        </el-form-item>
        <el-form-item label="注册IP：">
          <span>{{formData.create_ip}}</span>
        </el-form-item>
        <el-form-item label="创建时间：">
          <span>{{formData.create_time}}</span>
        </el-form-item>
        <el-form-item label="最后登录IP：">
          <span>{{formData.last_ip}}</span>
        </el-form-item>
        <el-form-item label="最后登录时间：">
          <span>{{formData.last_visit}}</span>
        </el-form-item>
        <el-form-item label="登录次数：">
          <span>{{formData.login_count}}</span>
        </el-form-item>
        <el-form-item label="1=默认 0=非默认：">
          <span>{{formData.init_default}}</span>
        </el-form-item>
        <el-form-item label="错误次数：">
          <span>{{formData.error_count}}</span>
        </el-form-item>
        <el-form-item label="用户token凭证：">
          <span>{{formData.token}}</span>
        </el-form-item>
        <el-form-item label="旧token：">
          <span>{{formData.old_token}}</span>
        </el-form-item>
        <el-form-item label="0=否 1=是：">
          <span>{{formData.need_new_pwd}}</span>
        </el-form-item>
        <el-form-item label="用户组id：">
          <span>{{formData.group_id}}</span>
        </el-form-item>
        <el-form-item label="管理端=1：">
          <span>{{formData.user_type}}</span>
        </el-form-item>
        <el-form-item label="用户端小程序id：">
          <span>{{formData.mp_c_id}}</span>
        </el-form-item>
        <el-form-item label="商户小程序id：">
          <span>{{formData.mp_b_id}}</span>
        </el-form-item>
        <el-form-item label="配送小程序id：">
          <span>{{formData.mp_r_id}}</span>
        </el-form-item>
        <el-form-item label="微信支付商户号：">
          <span>{{formData.wx_pay_id}}</span>
        </el-form-item>
        <el-form-item label="微信支付秘钥：">
          <span>{{formData.wx_pay_secret}}</span>
        </el-form-item>
        <el-form-item label="接入方式：">
          <span>{{formData.run_type}}</span>
        </el-form-item>
        <el-form-item label="抽佣比例：">
          <span>{{formData.commission_rate}}</span>
        </el-form-item>
        <el-form-item label="配送距离(km)：">
          <span>{{formData.delivery_radius}}</span>
        </el-form-item>
        <el-form-item label="数据版本字段：">
          <span>{{formData.version_id}}</span>
        </el-form-item>
      </el-form>
    </el-main>
  </el-container>
</template>
<style scoped>
body .app-container .el-container,
body .app-container .el-header,
body .app-container .el-main,
body .el-container,
body .el-header,
body .el-main {
  padding: 0;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
</style>
<script>
import { Loading } from "element-ui";
import {
  qr_sys_usersInfo
} from '@/api/project/wmyw/project_wmyw_qr_sys_users'
export default {
  name: "a_wmywa_qr_sys_users_info",
  data() {
    return {
      infoLoading: false,
      formData:{
        id: 0, 
        dept_id: 0, 
        role_id: 0, 
        user_number: '', 
        user_name: '', 
        real_name: '', 
        passwd: '', 
        gender: 0, 
        mobile: '', 
        email: '', 
        status: 0, 
        create_ip: '', 
        create_time: '2020/8/11 15:00:36', 
        last_ip: '', 
        last_visit: '2020/8/11 15:00:36', 
        login_count: 0, 
        init_default: 0, 
        error_count: 0, 
        token: '', 
        old_token: '', 
        need_new_pwd: 0, 
        group_id: 0, 
        user_type: 0, 
        mp_c_id: '', 
        mp_b_id: '', 
        mp_r_id: '', 
        wx_pay_id: '', 
        wx_pay_secret: '', 
        run_type: 0, 
        commission_rate: 0.0, 
        delivery_radius: 0, 
        version_id: 0, 
      }
    };
  },
  activated() {
    var result = location.search.match(new RegExp("[\?\&]id=([^\&]+)", "i"));
    if(result != null || result.length > 0){
      this.onInfo(result[1]);
    }
  },
  methods: {
    onInfo(id){
      this.infoLoading=true;
      qr_sys_usersInfo({id:id}).then(r=>{
        this.formData.id = r.dataSingle.id, 
        this.formData.dept_id = r.dataSingle.dept_id, 
        this.formData.role_id = r.dataSingle.role_id, 
        this.formData.user_number = r.dataSingle.user_number, 
        this.formData.user_name = r.dataSingle.user_name, 
        this.formData.real_name = r.dataSingle.real_name, 
        this.formData.passwd = r.dataSingle.passwd, 
        this.formData.gender = r.dataSingle.gender, 
        this.formData.mobile = r.dataSingle.mobile, 
        this.formData.email = r.dataSingle.email, 
        this.formData.status = r.dataSingle.status, 
        this.formData.create_ip = r.dataSingle.create_ip, 
        this.formData.create_time = r.dataSingle.create_time, 
        this.formData.last_ip = r.dataSingle.last_ip, 
        this.formData.last_visit = r.dataSingle.last_visit, 
        this.formData.login_count = r.dataSingle.login_count, 
        this.formData.init_default = r.dataSingle.init_default, 
        this.formData.error_count = r.dataSingle.error_count, 
        this.formData.token = r.dataSingle.token, 
        this.formData.old_token = r.dataSingle.old_token, 
        this.formData.need_new_pwd = r.dataSingle.need_new_pwd, 
        this.formData.group_id = r.dataSingle.group_id, 
        this.formData.user_type = r.dataSingle.user_type, 
        this.formData.mp_c_id = r.dataSingle.mp_c_id, 
        this.formData.mp_b_id = r.dataSingle.mp_b_id, 
        this.formData.mp_r_id = r.dataSingle.mp_r_id, 
        this.formData.wx_pay_id = r.dataSingle.wx_pay_id, 
        this.formData.wx_pay_secret = r.dataSingle.wx_pay_secret, 
        this.formData.run_type = r.dataSingle.run_type, 
        this.formData.commission_rate = r.dataSingle.commission_rate, 
        this.formData.delivery_radius = r.dataSingle.delivery_radius, 
        this.formData.version_id = r.dataSingle.version_id, 
        this.infoLoading=false;
      }).catch(()=>{
        this.infoLoading=false;
      });
    }
  }
}
</script>
